package com.uchengwang.ui.utils;

import android.text.TextUtils;
import android.util.Log;

import java.io.File;

/**
 * Created by U城网 on 2018/3/28.
 */

public class FileManager {

    private static FileManager manager;

    private FileManager(){}
    public static FileManager getManager() {
        if (manager ==null){
            manager = new FileManager();
        }
        return manager;
    }

    /**
     * 删除一个文件
     * */
    public boolean deleteFile(String fileUrl){
        if (TextUtils.isEmpty(fileUrl)){
            return false;
        }
        File file = new File(fileUrl);
        if (file.exists() && file.isFile()){
            boolean isDelete = file.delete();
            Log.d("ucw", "删除文件是否成功="+isDelete);

            return isDelete;
        }
        return false;
    }
}
